package com.autonavi.yunda.yunji.core.vo.node;

import com.autonavi.yunda.yunji.common.exception.AmapPreconditions;
import com.autonavi.yunda.yunji.core.enums.Method;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * @author cizhong.wcs
 * @date 2022/6/1 11:38
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class HttpNode extends BaseNode {
    public String url;
    public Method method = Method.GET;
    public Integer timeout;
    public Integer retryTimes;
    public boolean isVipServer;
    public String contentType = "application/json";
    public boolean useHttp_1;
    public Map<String, String> headers = new HashMap<>();

    @Override
    public void customParamCheck() {
        AmapPreconditions.checkArgumentForUser(StringUtils.isNoneBlank(url), "节点" + name + "[url]不能为空");
    }
}
